<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
require_once("{$CFG->libdir}/formslib.php");
/**
 * Класс формы гостевой книги
 */
class guestbook_form extends moodleform {
	function definition() {
		$mform =& $this->_form;
		$mform->addElement('header', 'guestbook_header', get_string('titleforlegend','block_guestbook'));
		$mform->addElement('html', '<div class="addmessage">');
		$mform->addElement('textarea', 'text', 'Add Message', array('rows'=>"5", 
				'cols'=>"45", 'wrap'=>"hard", 'autofocus'=>'autofocus', 'style' => 'resize:none;'));
		$mform->addElement('html', '</div">');
		//скрытые параметры идентификатор и имя таблицы
		$mform->addElement('hidden', 'id', $this->_customdata['id']);
		$mform->addElement('hidden', 'tbl_name', $this->_customdata['tbl_name']);
		$mform->setDefault('text', $this->_customdata['text']);
		$this->add_action_buttons(false, "send");
	}
	function validation($data, $files) {
    	$errors = parent::validation($data, $files);
	}
}

?>
